﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Data.Objects;
using GAE_PI.Models;
using GAE_PI.Exceptions;

namespace GAE_PI.Controllers
{
    public class ConsulterActivitesController : Controller
    {
        //
        // GET: /ConsulterActivites/

        public ActionResult ConsulterActivites()
        {
            try
            {
                return View(DBModel.getDBM().getActivites());
            }
            catch (GAEException ex)
            {
                ex.errorModel.ControllerName = "ConsulterActivites";
                ex.errorModel.ControllerAction = "ConsulterActivites";
                return View("Error", ex.errorModel);
            }
        }

        public ActionResult catalogueChanged(string value)
        {
            DBModel.getDBM().setCurrentCatalogueString(value);
            return RedirectToAction("ConsulterActivites");
        }

    }
}
